package com.team.common.result;

import lombok.Data;

@Data
public class R<T> {

    private String message;

    private String code;

    private T data;


    public R(T data){
        this.message = "success";
        this.code = "0000";
        this.data = data;
    }

    public R(String message ,String code){
        this.message = message;
        this.code = code;
    }

    public static <T> R success(T data){
        return new R(data);
    }

    public static R fail(String message,String code){
        return new R(message,code);
    }
}
